<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    // 获取body元素
    var bodyEle = document.body;
    console.log(bodyEle);
    // 获取html元素
    var htmlEle = document.documentElement;
    console.log(htmlEle);
  </script>
</body>
</html>